package com.meowcook.mapper;

import com.meowcook.pojo.dto.CollectionDTO;
import com.meowcook.pojo.po.Collection;
import com.meowcook.pojo.vo.CollectionVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 28792
 * Date: 2025-05-16
 * Time: 14:50
 */
@Mapper(componentModel = "spring")
public interface CollectionPojoMapper {
    CollectionPojoMapper INSTANCE = Mappers.getMapper(CollectionPojoMapper.class);

    @Mappings({
            @Mapping(source = "id", target = "id"),
            @Mapping(source = "isDeleted", target = "isDeleted")
    })
    CollectionVO toVO(Collection collection);

    @Mappings({
            @Mapping(source = "id", target = "id"),
            @Mapping(source = "userId", target = "userId"),
            @Mapping(source = "recipeId", target = "recipeId"),
            @Mapping(source = "isDeleted", target = "isDeleted"),
            @Mapping(source = "isBlocked", target = "isBlocked")
    })
    Collection toPO(CollectionDTO collectionDTO);
}
